package com.lzw.controller;

import com.lzw.common.bean.Client;
import com.lzw.common.controller.BaseController;
import com.lzw.common.tool.StringTool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 *
 * Created by 林志伟 on 2017/5/11.
 */
@Controller
public class IndexController extends BaseController {
    @GetMapping("/")
    public String index(){
        Client client= (Client) this.request.getAttribute("client");
        System.out.println("Client:"+client);
        return  this.getTemplateName();
    }
    @GetMapping("/welcome")
    public String welcome(){
        return  this.getTemplateName();
    }

    @GetMapping("/login")
    public String login(){

        return  this.getTemplateName();
    }


    @GetMapping("/test")
    @ResponseBody
    public String test(){

        return StringTool.md5("123456");
    }
}
